package com.newasia.shopping.dto;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 腾讯课堂搜索【咕泡学院】
 * 官网：www.gupaoedu.com
 * 风骚的Mic 老师
 * create-date: 2019/7/24-18:08
 */

public class ProductDetailDto implements Serializable {

    private static final long serialVersionUID = -597050593951733519L;

    private Long skuId;

    private Long spuId;

    private BigDecimal skuPrice;

    private Integer num;

    private Integer limitNum;

    private Integer status;

    private Date createTime;

    private Date updateTime;

    private String skuSpecListId;

    private String skuSpecListName;

    private String skuImage;

    private String skuName;

    private String attribute;

    private String sellPoint;

    private String brandName;

    private String catName;

    private String itemDesc;

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Long getSpuId() {
        return spuId;
    }

    public void setSpuId(Long spuId) {
        this.spuId = spuId;
    }

    public BigDecimal getSkuPrice() {
        return skuPrice;
    }

    public void setSkuPrice(BigDecimal skuPrice) {
        this.skuPrice = skuPrice;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getLimitNum() {
        return limitNum;
    }

    public void setLimitNum(Integer limitNum) {
        this.limitNum = limitNum;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getImageBig(){
        if (skuImage != null && !"".equals(skuImage)) {
            List<String> images = JSON.parseArray(skuImage,String.class);
            return images.get(0);
        }
        return null;
    }

    public String getSkuName() {
        return skuName;
    }

    public void setSkuName(String skuName) {
        this.skuName = skuName;
    }

    public String getAttribute() {
        return attribute;
    }

    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }

    public String getSellPoint() {
        return sellPoint;
    }

    public void setSellPoint(String sellPoint) {
        this.sellPoint = sellPoint;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getCatName() {
        return catName;
    }

    public void setCatName(String catName) {
        this.catName = catName;
    }

    public String getItemDesc() {
        return itemDesc;
    }

    public void setItemDesc(String itemDesc) {
        this.itemDesc = itemDesc;
    }

    public List<Long> getSpecIds() {
        return JSON.parseArray(this.skuSpecListId,Long.class);
    }

    public void setSpecIds(List<Long> specIds) {
        this.skuSpecListId = JSON.toJSONString(specIds);
    }

    public List<String> getSpecNames() {
        return JSON.parseArray(this.skuSpecListName,String.class);
    }

    public void setSpecNames(List<String> specNames) {
        this.skuSpecListName = JSON.toJSONString(specNames);
    }


    public void setImageList(List<String> imageList) {
        this.skuImage = JSON.toJSONString(imageList);
    }

    public List<String> getImageList(){
        return JSON.parseArray(this.skuImage,String.class);
    }
}
